]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
quickSettings: Remove null checks
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Wed, 1 Feb 2023 15:32:11 +0000 (12:32 -0300)
committerMarge Bot <marge-bot@gnome.org>
Sun, 12 Feb 2023 16:16:36 +0000 (16:16 +0000)
The '_overlay' field is always set at construction to a valid actor,
so there's no need to protect against null here.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2624>

js/ui/quickSettings.js

index ef8d06e51d6fa5d6a12d5b8a16ad126d00181711..4868cf6b304940ce8120e1b6b9837d42aff80048 100644 (file)
@@ -631,9 +631,7 @@ const QuickSettingsLayout = GObject.registerClass({
     vfunc_get_preferred_height(container, _forWidth) {
         const rows = this._getRows(container);
 
-        let [minHeight, natHeight] = this._overlay
-            ? this._overlay.get_preferred_height(-1)
-            : [0, 0];
+        let [minHeight, natHeight] = this._overlay.get_preferred_height(-1);
 
         const spacing = (rows.length - 1) * this.row_spacing;
         minHeight += spacing;
@@ -651,14 +649,12 @@ const QuickSettingsLayout = GObject.registerClass({
     vfunc_allocate(container, box) {
         const rows = this._getRows(container);
 
-        const [, overlayHeight] = this._overlay
-            ? this._overlay.get_preferred_height(-1)
-            : [0, 0];
+        const [, overlayHeight] = this._overlay.get_preferred_height(-1);
 
         const availWidth = box.get_width() - (this.nColumns - 1) * this.column_spacing;
         const childWidth = Math.floor(availWidth / this.nColumns);
 
-        this._overlay?.allocate_available_size(0, 0, box.get_width(), box.get_height());
+        this._overlay.allocate_available_size(0, 0, box.get_width(), box.get_height());
 
         const isRtl = container.text_direction === Clutter.TextDirection.RTL;